package it.valeandre.omino.ui;

import it.valeandre.omino.R;
import it.valeandre.omino.utils.Utils;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.CheckBox;

public class CheckBoxCustom extends CheckBox {

	public CheckBoxCustom(Context context) {
		super(context);
	}

	public CheckBoxCustom(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		setTypeFace(context, attrs);

	}

	public CheckBoxCustom(Context context, AttributeSet attrs) {
		super(context, attrs);
		setTypeFace(context, attrs);

	}

	private void setTypeFace(Context context, AttributeSet attrs) {
		TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.TextViewCustom);
		String text = array.getString(R.styleable.TextViewCustom_fontCustom);
		if (text != null) {
			setTypeface(Utils.getTypeface(context, text));
		}

	}

}
